var Sniper = Weapon.extend({
	init : function() {
		this.sound = awpSound;
		this.placeInArray = 3;
		this.img = new Image();
		this.img.src = "WebContent/img/sniper-edited.png"; // LF image
		this.frames = 3;
		this.frameWidth = 200;
		this.frameHeight = 200;
		this.maxBulletsInMagazine = 10;
		this.currentBullets = 10;
		this.extraMagazines = 0;
		this.currentFrame = 0;
		this.damage = 115;
		this.reloadTime = 60;
		this.reloadingCounter = 0;
		this.frameDelay = 1;
		this.maxFrameDelay = 4;
		this.shootDelay = 26;
		this.shootDelayMax = 26;
		this.reloading = false;
		this.shooting = true;
		this.normalScale = 1;
		this.scaleAim = 1;
		this.maxScale = 2;
		this.xCoord;
		this.yCoord;
		this.scaleGrow = 1;
		this.scaleShrink = 1;
		this.bulletsPerShoot = 1;
		this.shoot = true;
		this.shoted = false;
		this.price = 2000;
		this.aiming = false;
		this.floatLeft = 150;
		this.penetrated = 0;
		this.penetration = 1;
		this.picture = "WebContent/img/sniper_rifle.png";
		this.haveIt = false;// new for shop
		this.ammoPrice = 160;// new for shop
		this.name = "Sniper";// new for shop
		this.maxExtraMagazines = 3;// new for shop

	},
	aim : function() {
		this.aiming == false ? this.aiming = true : this.aiming = false;
	},
	drawScope : function() {
		if (this.aiming == true) {
			ctx.save();
			ctx.fillStyle = 'black';
			ctx.fillRect(0, 0, 1000, 700);
			ctx.beginPath();
			ctx.arc(x, y + 10, 100, 0, 2 * Math.PI);
			ctx.clip();
		}
	},
	drawScopeLines : function() {
		if (player.weapons[player.currentWeapon].aiming == true) {
			console.log("a");
			ctx.beginPath();
			ctx.arc(x, y + 10, 5, 0, Math.PI * 2);
			ctx.fillStyle = 'black';
			ctx.fill();
			ctx.closePath();
			ctx.moveTo(x - 100, y + 10);
			ctx.lineTo(x - 70, y + 10);
			ctx.moveTo(x + 70, y + 10);
			ctx.lineTo(x + 100, y + 10);
			ctx.moveTo(x, y - 90);
			ctx.lineTo(x, y - 60);
			ctx.moveTo(x, y + 80);
			ctx.lineTo(x, y + 110);
			ctx.lineWidth = 3;
			ctx.stroke();
			ctx.moveTo(x - 60, y + 10);
			ctx.lineTo(x - 30, y + 10);
			ctx.moveTo(x + 30, y + 10);
			ctx.lineTo(x + 60, y + 10);
			ctx.moveTo(x, y - 50);
			ctx.lineTo(x, y - 50);
			ctx.moveTo(x, y + 50);
			ctx.lineTo(x, y + 50);
			ctx.lineWidth = 1;
			ctx.stroke();

		}
	}
});